package com.hongshan.wallet.core.home

import android.support.v7.widget.GridLayoutManager
import com.hongshan.wallet.bean.PaymentMethod

/**
 * Copyright Zhangxx.
 * Copyright (c) 2019
 * All rights reserved
 *
 * @project  : Wallet
 * @package  : com.example.wallet.core.home
 * @author   : zhangxx
 * @date     : 2019/4/10
 * @email    : qq957413212@hotmail.com
 * @desc     : //TODO
 */
class PayMethodSpanSizeLookup(val payMethods:List<PaymentMethod>): GridLayoutManager.SpanSizeLookup() {
    override fun getSpanSize(position: Int) = when(position){
        0 -> 2
        payMethods.size-1 -> 2
        in payMethods.size .. payMethods.size + 1 -> 1
        else -> 2
    }
}